/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package iagente;

public class MatrizR {
    
        //Instancia de la Matriz de recompenza
	public static MatrizR instance = null;

        //Tipos de Atributos
	public static final char AGENTE = 'R';
	public static final char POZO = 'D';
	public static final char FINAL = 'G';
	public static final char VIRTUAL_ROBOT = 'V';
	public static final char PARED = '#';
	public static final char NEUTRO = ' ';
	public static final char LLEGADAFINAL = 'H';
        public static final char MALA = 'M';
        public static final char BUENA = 'B';
        public static final char EXCELENTE = 'E';
        
        
        // Directions
	public static final int arriba    = 0;
        public static final int arribaizq   = 1;
        public static final int arribader   = 2;
	public static final int abajo  = 3;
        public static final int abajoizq = 4;
        public static final int abajoder = 5;
	public static final int izquierda  = 6;
	public static final int derecha = 7;
	
	
	
	// Array for giving reward to our states
	public double[] r_matriz; 
	
	
	// Constructor
	public MatrizR()
	{
		r_matriz	= new double[Interfaz.tamaño];
                inicializarValores();
                
         
	}
	
	
	
	
	// Initializes Reward Matrix looking to the map state
	private void inicializarValores()
	{
		for(int i = 0; i < Interfaz.tamaño; i++)
		{
			if(Interfaz.getMapa().map[i] == FINAL)
				r_matriz[i] = Interfaz.estadofinal;
			
			else if(Interfaz.getMapa().map[i] == POZO)
				r_matriz[i] = Interfaz.pozo;
			 else if(Interfaz.getMapa().map[i] == BUENA)
                             r_matriz[i] = Interfaz.buena;
                        
                        else if(Interfaz.getMapa().map[i] == EXCELENTE)
                            r_matriz[i] = Interfaz.excelente;
                        
                        else if(Interfaz.getMapa().map[i] == MALA)
                            r_matriz[i] = Interfaz.mala;
			else
				r_matriz[i] = 0;		
		}
                
	}
	
    
}
